<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/3.0.5/vue.global.js"></script>
</head>

<body>
    <div id="app" class="demo">
        <hr>
        <div>{{msg}}</div>
        <hr>
        <div>{{msg_c}}</div>

        <button @click="change">变换</button>
    </div>

</body>
<script>

    const HelloVueApp = {
        data() {
            return {
                msg:4,
            }
        },
        methods:{
            change(){
                this.msg++;
            }
        },
        computed:{
            msg_c:function(){
                return this.msg + 3;
            }
        }
    }
    Vue.createApp(HelloVueApp).mount('#app')
</script>

</html>